<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{faJournalBean.id}"/>
		<f:event type="preRenderView" listener="#{faJournalBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Fa Journal"/>

	<ui:define name="header">
		Fa Journal
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty faJournalBean.id}">
				Edit existing Fa Journal
			</c:when>
			<c:otherwise>
				Create a new Fa Journal
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="faJournalBeanFaJournalJnNo" value="Jn No:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnNo" required="true" value="#{faJournalBean.faJournal.jnNo}"/>
					<h:message for="faJournalBeanFaJournalJnNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="faJournalBeanFaJournalFaAccountCategory" value="Fa Account Category:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{faAccountCategoryBean.converter}" id="faJournalBeanFaJournalFaAccountCategory" value="#{faJournalBean.faJournal.faAccountCategory}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{faAccountCategoryBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="faJournalBeanFaJournalFaAccountCategory" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalSysOrg" value="Sys Org:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{sysOrgBean.converter}" id="faJournalBeanFaJournalSysOrg" value="#{faJournalBean.faJournal.sysOrg}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="faJournalBeanFaJournalSysOrg" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalHrEmp" value="Hr Emp:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{hrEmpBean.converter}" id="faJournalBeanFaJournalHrEmp" value="#{faJournalBean.faJournal.hrEmp}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{hrEmpBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="faJournalBeanFaJournalHrEmp" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalJnDtm" value="Jn Dtm:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnDtm" maxLength="19" value="#{faJournalBean.faJournal.jnDtm}">
						<f:convertDateTime pattern="MMM d, yyyy hh:mm:ss a" type="both"/>
					</h:inputText>
					<h:message for="faJournalBeanFaJournalJnDtm" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalJnCode" value="Jn Code:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnCode" maxLength="50" value="#{faJournalBean.faJournal.jnCode}"/>
					<h:message for="faJournalBeanFaJournalJnCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalJnDescr" value="Jn Descr:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnDescr" maxLength="300" value="#{faJournalBean.faJournal.jnDescr}"/>
					<h:message for="faJournalBeanFaJournalJnDescr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalJnDocCode" value="Jn Doc Code:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnDocCode" maxLength="50" value="#{faJournalBean.faJournal.jnDocCode}"/>
					<h:message for="faJournalBeanFaJournalJnDocCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalJnAmt" value="Jn Amt:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnAmt" required="true" value="#{faJournalBean.faJournal.jnAmt}"/>
					<h:message for="faJournalBeanFaJournalJnAmt" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="faJournalBeanFaJournalJnStatusIsPosting" value="Jn Status Is Posting:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnStatusIsPosting" value="#{faJournalBean.faJournal.jnStatusIsPosting}"/>
					<h:message for="faJournalBeanFaJournalJnStatusIsPosting" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalJnMemo" value="Jn Memo:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnMemo" maxLength="500" value="#{faJournalBean.faJournal.jnMemo}"/>
					<h:message for="faJournalBeanFaJournalJnMemo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalJnCreatedDtm" value="Jn Created Dtm:"/>
				<h:panelGroup>
					<h:inputText id="faJournalBeanFaJournalJnCreatedDtm" maxLength="19" value="#{faJournalBean.faJournal.jnCreatedDtm}">
						<f:convertDateTime pattern="MMM d, yyyy hh:mm:ss a" type="both"/>
					</h:inputText>
					<h:message for="faJournalBeanFaJournalJnCreatedDtm" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalFaJournalLines" value="Fa Journal Lines:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{faJournalBean.faJournal.faJournalLines}"/>
					<h:dataTable id="faJournalBeanFaJournalFaJournalLines" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Dr Amt"/>
							</f:facet>
							<h:link outcome="/faJournalLine/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemJnDrAmt" value="#{_item.jnDrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalLineBeanAddJnDrAmt" value="#{faJournalLineBean.add.jnDrAmt}"/>
								<h:message for="faJournalLineBeanAddJnDrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Cr Amt"/>
							</f:facet>
							<h:link outcome="/faJournalLine/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemJnCrAmt" value="#{_item.jnCrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalLineBeanAddJnCrAmt" value="#{faJournalLineBean.add.jnCrAmt}"/>
								<h:message for="faJournalLineBeanAddJnCrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Status Dr Cr"/>
							</f:facet>
							<h:link outcome="/faJournalLine/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemJnStatusDrCr" value="#{_item.jnStatusDrCr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalLineBeanAddJnStatusDrCr" value="#{faJournalLineBean.add.jnStatusDrCr}"/>
								<h:message for="faJournalLineBeanAddJnStatusDrCr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(faJournalLineBean.added)}" id="faJournalBeanFaJournalFaJournalLinesAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{faJournalLineBean.add.faJournal}" value="#{faJournalBean.faJournal}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="faJournalBeanFaJournalFaGlTranses" value="Fa Gl Transes:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{faJournalBean.faJournal.faGlTranses}"/>
					<h:dataTable id="faJournalBeanFaJournalFaGlTranses" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl No"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlNo" value="#{_item.glNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlNo" value="#{faGlTransBean.add.glNo}"/>
								<h:message for="faGlTransBeanAddGlNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Dr Amt"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlDrAmt" value="#{_item.glDrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlDrAmt" value="#{faGlTransBean.add.glDrAmt}"/>
								<h:message for="faGlTransBeanAddGlDrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Cr Amt"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlCrAmt" value="#{_item.glCrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlCrAmt" value="#{faGlTransBean.add.glCrAmt}"/>
								<h:message for="faGlTransBeanAddGlCrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Status Dr Cr"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlStatusDrCr" value="#{_item.glStatusDrCr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlStatusDrCr" value="#{faGlTransBean.add.glStatusDrCr}"/>
								<h:message for="faGlTransBeanAddGlStatusDrCr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Gl Status Is Close"/>
							</f:facet>
							<h:link outcome="/faGlTrans/view">
								<f:param name="id" value="#{_item.glNo}"/>
								<h:outputText id="itemGlStatusIsClose" value="#{_item.glStatusIsClose}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faGlTransBeanAddGlStatusIsClose" value="#{faGlTransBean.add.glStatusIsClose}"/>
								<h:message for="faGlTransBeanAddGlStatusIsClose" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(faGlTransBean.added)}" id="faJournalBeanFaJournalFaGlTransesAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{faGlTransBean.add.faJournal}" value="#{faJournalBean.faJournal}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{faJournalBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty faJournalBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{faJournalBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{faJournalBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>